Dear all, I am a newbe in DXL world, I would appreciate any suggestions. I have to create an attribute B that filters the attribute A. If A contains "YES" B must be "YES". I tried with something like if (o."A".contains("YES")) o."B"="YES" but it is not correct. Where can I find a good guide for DXL? Thanks in advance
Dario_Imparato - Tue Sep 22 12:17:46 EDT 2015 |
Re: Create attribute filter The ONLY guide to DXL is the DXL Reference Manual available through your DOORS client: Help / DXL Reference Manual. If you do a net search for "DXL tutorial" you might also find some information to start yourself up on DXL.
On filters: read the DXL reference section on filters, note it has also a filters example program showing how to use filtering commands in DXL. |
Re: Create attribute filter
And also of course this forum, use the search here to find examples on setting an attribute filter by DXL |
Re: Create attribute filter PekkaMakinen - Wed Sep 23 00:36:06 EDT 2015 The ONLY guide to DXL is the DXL Reference Manual available through your DOORS client: Help / DXL Reference Manual. If you do a net search for "DXL tutorial" you might also find some information to start yourself up on DXL.
On filters: read the DXL reference section on filters, note it has also a filters example program showing how to use filtering commands in DXL. Hello PekkaMakinen, thank you for your answer. I used the following code to solve my problem (it could be useful for others):
|
Re: Create attribute filter You don't want a filter. Attribute "B" should be defined as an attribute-DXL, presumably of type "string"
This presumes you do not want to match "YES" in a work "XYES" nor "YESPLEASE". The buffer "contains" is looking for a word. If you DO want to match those, then forget the buffer and try
When you are done with that you can define a view that "Filters" on whether attribute "B" is "YES". -Louie |
Re: Create attribute filter llandale - Sat Sep 26 16:12:42 EDT 2015 You don't want a filter. Attribute "B" should be defined as an attribute-DXL, presumably of type "string"
This presumes you do not want to match "YES" in a work "XYES" nor "YESPLEASE". The buffer "contains" is looking for a word. If you DO want to match those, then forget the buffer and try
When you are done with that you can define a view that "Filters" on whether attribute "B" is "YES". -Louie Do you mean contains is similar to java contains and matches is similar to equals? |
Re: Create attribute filter Dario_Imparato - Mon Sep 28 15:47:09 EDT 2015 Do you mean contains is similar to java contains and matches is similar to equals? I don't use "contains". I don't know anything about java. "contains" in a buffer is looking for some kind of "word".
So I guess it won't find "XYES" but will find " YESPLEASE". "matches" is looking for the string exactly anywhere. Be advised that "matches" is particularly inefficient as it creates allocated unit "Regexp" each time. This is better: Regexp reHasYes = regexp2("YES") // at top of program .... if (reHasYes obj."A" "") ... -Louie Errata: I see the word "after" at the end of the description. it appears I should have a "-1" instead of "0" in this line of code:
|